<script setup lang="ts">
import { ref } from 'vue'
import SingleStackViewer from '../../../../components/SingleStackViewer.vue'
import { createImageIdsAndCacheMetaData } from '@/helpers/index.js'
import { getDicomSource } from '@/config/config'

let imageIdsRef = ref()

async function downloadAndView() {
  const params = getDicomSource()
  console.log(params)
  const totalIds = await createImageIdsAndCacheMetaData(params)
  imageIdsRef.value = totalIds.slice(0, 50)
}

downloadAndView()
const prefix = 'stack-viewer-network'
const ids = {
  toolsGroupId: prefix,
  viewportId: `${prefix}-CT_STACK`,
  renderingEngineId: `${prefix}-renderEngine`
}

</script>

<template>
  <single-stack-viewer :imageIds="imageIdsRef" :ids="ids" />
</template>

<style scoped>

</style>
